Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

HC-58: Fix Problems Scheduling Unlimited Resources #159

Merged
merged 5 commits into from
Nov 28, 2017
Merged

Conversation

MiyaNoctem
Copy link
Contributor

@MiyaNoctem MiyaNoctem commented Nov 28, 2017

Overview

Loading of options is done via a series of chained API calls, from Resource, to Resource Set, to Resource Set Options. A bug injected on CiviCRM v4.7.19 on PR civicrm/civicrm-core#10033, caused chained API calls using '$value.' to chain values to be interpreted as operators with syntax: array('OP' => $val) instead. This only happened if the first parameter for the chained API call uses '$value.'. The bug has been fixed on CiviCRM core and is set to be released on v4.7.28.

See PR #158.

Before

The fix for v4.7.19 to v4.7.27 needs to be merged into master to deploy production sites.

After

The fix is merged into master branch of CiviBooking to be deployed on production sites.

A bug injected on CiviCRM v4.7.19 caused chained API calls using '$value.' to
chain values to previous call to be interpreted as operators with syntax:
array('OP' => $val). This only happened if the first parameter for the chained
API call uses '$value.'.

Fixed by implementing civicrm_apiWrappers hook to preprocess parameters array
to make sure the first parameter of a chained API call is is not a chained
value.
As what the implemented fix does is move chained values to the last position
of the array, if all the parameters of the call are chained values, the
problem would still present itself.

Added check to verify if all values are chained and if so, added sequential
flag with 0 value as parameter.
Cycle to check if values of a chained call were all chained was botched, as it
was checking the whole array of parameters on each cycle, instead of each
individual value.
…unnlimited-resources

HC-58: Fix Problems Scheduling Unlimited Resources
@MiyaNoctem MiyaNoctem changed the title Fix Problems Scheduling Unlimited Resources HC-58: Fix Problems Scheduling Unlimited Resources Nov 28, 2017
Copy link

@mickadoo mickadoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🍏

@MiyaNoctem MiyaNoctem merged commit 685328c into master Nov 28, 2017
@MiyaNoctem MiyaNoctem deleted the develop branch November 28, 2017 17:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants